
<style type="text/css">
    body p {
    color: #666;
    font-size: 12px;
}
</style>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="css/table.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" type="text/css" href="css/style.css" />
<link rel="stylesheet" type="text/css" href="css/button.css" />
<title>三级密码验证</title>

</head>
<?php

/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/7/1
 * Time: 9:51
 */
include("check.php");
include_once("../function.php");
session_start();

$_html="guamaijifen.php";
//如果输入过2级密码就不需要再输入
if ($_SESSION['pass3'] == 1){
    echo "<script language=javascript>window.location.href='".$_html."'</script>";
}
//验证二级密码
if($_POST['submit']){
    if (checkPassword3($_SESSION['nickname'],$_POST['password3'])){
        $_SESSION['pass3']=1;
        if ($_html == null){
            echo "<script language=javascript>window.location.href='main.php'</script>";
        }else{
            echo "<script language=javascript>window.location.href='".$_html."'</script>";
        }
    }else{
        echo "<script language=javascript>alert('三级密码错误,请重新输入.');window.location.href='?'</script>";
    }
}
?>
<body>
<form name="form1" method="POST" action="?">
    <table width="300" border="0" align="center" cellpadding="3" cellspacing="1" class="table1">
        <tr>
            <td align="center" height="50px"><p style=" color:#F00"><B>请输入三级密码：</B>
                    <input name="password3" type="password" id="password3" size="20"></p></td>
        </tr>
        <tr>
            <td align="center"><input name="submit" type="submit" class="button_green" value="确  认"></td>
        </tr>
    </table>
</form>
</body>
</html>